#ifndef __MY_TYPE_H__
#define __MY_TYPE_H__

#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif

#include <stdlib.h>
#include <string.h>

typedef unsigned char           MY_U8;
typedef unsigned short          MY_U16;
typedef unsigned int            MY_U32;
typedef unsigned long 			paddr_t;

typedef signed char           	MY_S8;
typedef short                   MY_S16;
typedef int                     MY_S32;

typedef float                   MY_F32;
typedef double               	MY_F64;

#ifdef WIN32
	typedef __int64             MY_U64;
	typedef __int64             MY_S64;
#else
    typedef unsigned long long  MY_U64;
    typedef long long           MY_S64;
#endif

typedef char                    MY_CHAR;
typedef char                    CHAR;

#define MY_VOID                 void
#define VOID                 	void


//枚举类型
typedef enum 
{
    MY_FALSE	= 0,
    MY_TRUE 	= 1,
} MY_BOOL;

typedef unsigned int			UINTPTR;


#define LOS_OFF_SET_OF(type, member) 				((UINTPTR)&((type *)0)->member)
#define LOS_DL_LIST_ENTRY(item, type, member)		((type *)(VOID *)((CHAR *)(item) - LOS_OFF_SET_OF(type, member)))
#define CLZ(value)                                  (__builtin_clz(value))
#define CTZ(value)              					(__builtin_ctz(value))

#define KB                               			(1024UL)
#define MB                               			(1024UL * 1024UL)
#define GB                               			(1024UL * 1024UL * 1024UL)

#define HEAP_BLOCK_SIZE               				(512 * 1024UL)
#define ROUNDUP(a, b)                    			(((a) + ((b) - 1)) & ~((b) - 1))
#define	INVALID_BIT_INDEX							32


#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif

#endif

